// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "Packet.h"

template<typename T>
class CLIENTNET_API Singleton
{
private:
	static T* pInstance;

public:
	Singleton()
	{
		pInstance = static_cast<T*>(this);
	}

public:
	static T* GetInstancePtr()
	{
		return pInstance;
	}

	static T& GetInstance()
	{
		return *pInstance;
	}

};

/**
 * 
 */
class CLIENTNET_API PacketFactory : public Singleton<PacketFactory>
{
public:
	PacketFactory();
	~PacketFactory();

public:
	Packet* CreatePacket(int16 id);
};
